import React, { useRef } from 'react'

const useLoadach = () => {
  const time = useRef(null)
  function fd(cb, delay) {
    clearTimeout(time.current)
    time.current = setTimeout(() => {
      cb()
    }, delay)
  }
  return fd
}

export default useLoadach
